package com.example.nacos.cal;


import java.util.HashMap;
import java.util.Map;

public class FundReturnsResult {
    private String fundCode;
    private Map<String, Double> returns;

    public FundReturnsResult() {
        this.returns = new HashMap<>();
    }

    public FundReturnsResult(String fundCode) {
        this.fundCode = fundCode;
        this.returns = new HashMap<>();
    }

    public String getFundCode() {
        return fundCode;
    }

    public void setFundCode(String fundCode) {
        this.fundCode = fundCode;
    }

    public Map<String, Double> getReturns() {
        return returns;
    }

    public void setReturns(Map<String, Double> returns) {
        this.returns = returns;
    }

    public void addReturn(String period, Double value) {
        this.returns.put(period, value);
    }

    public Double getReturn(String period) {
        return this.returns.get(period);
    }

    @Override
    public String toString() {
        return "FundReturnsResult{" +
                "fundCode='" + fundCode + '\'' +
                ", returns=" + returns +
                '}';
    }
}
